<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    *{
      margin: 0%;
      padding: 0%;
    }

    .box {
      width: 500px;
      height: 500px;
      border: 1px solid red;
      margin: 100px auto;
    }

    .box img {
      margin-left: 200px;
      margin-top: 300px;
      transform-origin: 110px 80px;
      animation: routesImg 3s linear,contrarotate 2s 3s infinite linear;
    }

    @keyframes routesImg {
      to {
        transform: rotate(0deg);
      }

      from {
        transform: rotate(540deg);
      }
    }

    /* 逆时针旋转 */
    /* .contrarotate {
      transform-origin: 110px 80px;
      animation: contrarotate infinite linear;
    } */

    @keyframes contrarotate {
      to {
        transform: rotate(0deg);
      }
      from {
        transform: rotate(-360deg);
      }
    }

  </style>
</head>
<body>
  <div class="box">
    <img src="../images/routeImg.png" alt="">
  </div>
</body>
<script>
  const img = document.querySelector('img');
  console.log(img)

  // 三秒后逆时针旋转
  // const timer = setTimeout(function(){
  //   img.classList.add('contrarotate')
  // },3000)
  // console.log(img)

  // clearTimeout(tiemr)
</script>
</html>